libmystdio.so:my_string.o my_stdio.o
	gcc -o $@ $^ -shared 
%.o:%.c
	gcc -fPIC -c $<

.PHONY:clean
clean:
	rm -rf *.o *.so stdc*

output:
	@mkdir -p stdc/include
	@mkdir -p stdc/lib 
	@cp -f *.h stdc/include
	@cp -f *.so stdc/lib
	@tar -czf stdc.tgz stdc
	@echo "output stdc ... done"



#libmystdio.a:my_string.o my_stdio.o
#	@ar -rc $@ $^
#	@echo "bulid $^ to $@ ... done"
#%.o:%.c
#	@gcc -c $<
#	@echo "compling $< to $@ ... done"
#
#.PHONY:clean
#clean:
#	@rm -rf *.o *.a stdc*
#	@echo "clean ... done"
#
#.PHONY:output
#output:
#	@mkdir -p stdc/include
#	@mkdir -p stdc/lib 
#	@cp -f *.h stdc/include
#	@cp -f *.a stdc/lib
#	@tar -czf stdc.tgz stdc
#	@echo "output stdc ... done"
